-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: remove optional fields when unnecessary #216
Conversation
…veOptionalFieldsWhenUnnecessary
Lemme know when I should review this. I could see splitting it into smaller PRs, but only if that's easier for you. |
src/lib/decode-conversions.ts
Outdated
@@ -95,7 +95,8 @@ export const convertObservation: ConvertFunction<'observation'> = ( | |||
...rest, | |||
attachments: message.attachments.map(convertAttachment), | |||
tags: convertTags(message.tags), | |||
metadata: message.metadata || {}, | |||
// @ts-ignore |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Once I solve this type error, which I'm not being able for the time being, I think this is mostly ready to merge
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM other than the ts-ignore
error.
@@ -95,7 +95,7 @@ export const convertObservation: ConvertFunction<'observation'> = ( | |||
...rest, | |||
attachments: message.attachments.map(convertAttachment), | |||
tags: convertTags(message.tags), | |||
metadata: message.metadata || {}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we set up a default value for metadata it should be smth like {manualLocation:true}
, since manualLocation
now is required. That field will default to false
if undefined, so if we're okay with that, maybe we could leave it undefined?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As long as we don't accidentally get manualLocation: undefined
when reading, I'm fine with whatever.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to this at least, we should be fine
Just seeing this now following the issues with the front end. I think there are one or two things we need to review here. I can take a look Monday morning. @EvanHahn @tomasciccola |
should close #200